function trim (myString)
{
return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
}

function stayRightThere() {
	Y = window.pageYOffset;
	X = window.pageXOffset;
	window.setTimeout(function() { window.scroll(X, Y); }, 1);
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
function estCeUneExtenstionPossible(extension) {
		extensionsPossible = new Array();
		extensionsPossible[0]='pdf';
		extensionsPossible[1]='txt';
		extensionsPossible[2]='jpg';
		extensionsPossible[3]='bmp';
		extensionsPossible[4]='gif';
		extensionsPossible[5]='html';
		
		trouve=false;
		for (i=0;i<extensionsPossible.length;i++) {
		
			if (trim(extensionsPossible[i].toUpperCase()) == trim(extension.toUpperCase())) {
//alert(extensionsPossible[i]+" "+extension);		
		trouve=true;
			}
		}
		return trouve;
	 }
   
 function getSize(isWidthWanted) {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    if (isWidthWanted==true) {
		return window.innerWidth;
	}
	else {
		return window.innerHeight;
	}
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    if (isWidthWanted==true) {
		return document.documentElement.clientWidth;
	}
	else {
		return document.documentElement.clientHeight;
	}
	
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	if (isWidthWanted==true) {
		return document.body.clientWidth;
	}
	else {
		return document.body.clientHeight;
	}
  }
}

	 
	 
	 
	 